#include <iostream>
#include <vector>


using namespace std;

// 2533. 好二进制字符串的数量
// https://leetcode.cn/problems/number-of-good-binary-strings/description/

class Solution {
    int mod = 1e9 + 7;

public:
    int goodBinaryStrings(int minLength, int maxLength, int oneGroup, int zeroGroup) {
        vector<long long> dp(maxLength + 1);
        dp[0] = 1;
        long long ans = 0;
        for (int i = min(oneGroup, zeroGroup); i <= maxLength; i++)
        {
            long long pre1 = 0;
            long long pre2 = 0;
            if(i - oneGroup >= 0){
                pre1 = dp[i - oneGroup];
            }
            if(i - zeroGroup >= 0){
                pre2 = dp[i - zeroGroup];
            }
            dp[i] = (pre1 + pre2) % mod;
        }
        for (int i = minLength; i <= maxLength; i++){
            ans = (ans + dp[i])%mod;
        }
        return ans;
    }
};

int main()
{
    return 0;
}